pub struct Solution;

impl Solution {
    pub fn construct_rectangle(area: i32) -> Vec<i32> {
        let mut width = 0;
        let mut length = 1;
        let mut temp = 0;
        while temp < length {
            let m = area % (temp + 1);
            if m == 0 {
                let i = area / (temp +1);
                if i >= temp +1 {
                    length = i;
                    width = temp + 1;
                }
            }
            temp += 1;
        }
        vec![length, width]
    }
}